<?php

require '../model-db-connection/config.php';

$project_order_status =$_GET['project_order_status'];
$project_home_plan = $_GET['project_home_plan'];
$project_home_plot =$_GET['project_home_plot'];
$project_document_no = $_GET['project_document_no'];
$project_po_no = $_GET['project_po_no'];
$project_po_owner = $_GET['project_po_owner'];
$project_po_sender = $_GET['project_po_sender'];
$project_order_type = $_GET['project_order_type'];
$project_plan_size = $_GET['project_plan_size'];
$project_unit_price = $_GET['project_unit_price'];
$project_amount = $_GET['project_amount'];
$project_vat = $_GET['project_vat'];
$project_image_path = $_GET['project_image_path'];
$project_code = $_GET['project_code'];

$projectOrderID = md5(date('l jS \of F Y h:i:s A')."_".$project_code);
$sqlInsertIntoProjectOrderTbl = "INSERT INTO QRC_PROJECT_ORDER (project_order_id,project_code,project_order_plan,project_order_plot,document_no,po_no,po_owner,po_sender,created_date_time,order_type,plan_size,unit_price,amount,include_vat,image_name,project_status)"
        . " VALUES "
        . "('$projectOrderID','$project_code','$project_home_plan','$project_home_plot','$project_document_no','$project_po_no','$project_po_owner','$project_po_sender',NOW(),'$project_order_type','$project_plan_size','$project_unit_price','$project_amount','$project_vat','$project_image_path','$project_order_status');";

$resultSet = mysql_query($sqlInsertIntoProjectOrderTbl);
if($resultSet){
    echo '1';
}else{
    echo '0';
}